<!-- dialog测试 -->
<template>
  <div>
    <div @click="openDialog">打开关闭弹窗</div>
    <div @click="openDialog2">打开弹窗2</div>
    <div @click="closeDialog2">关闭弹窗2</div>
    <div @click="getValue">获取弹窗值</div>
    <div @click="openRightDialog">打开右侧窗体</div>
    <diaLog ref="d1" :cover="false" type="right" :source="diaLogSource">
      <div style="height:100%;background:#6666;">内容</div>
    </diaLog>
    <diaLog
      ref="dialog"
      :cover="false"
      @beforeHideMethod="beforeHideMethod"
      @close="colseEditorDialog"
      :source="{title:'测试弹窗'}"
    >
      <div style="height:100%;background:#6666;">内容</div>
    </diaLog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      showDialog: true,
      diaLogSource: {
        title: '新增',
        created: true,
        closeBtn: false,
        buttons: [{ text: '确认', inspect: true, event: this.click }]
      }
    }
  },

  components: {},

  computed: {},

  watch: {},

  mounted() {},

  created() {},

  methods: {
    colseEditorDialog() {},
    async beforeHideMethod(callback) {
      callback({
        showBeforeHideDialog: true,
        beforeHideDialogText: '$$$',
        val: false
      })
    },
    getValue() {
      console.log(this.showDialog)
    },
    openDialog() {
      this.showDialog = !this.showDialog
    },
    openRightDialog() {
      this.$refs.d1.open()
    },
    openDialog2() {
      this.$refs.dialog.open()
    },
    closeDialog2() {
      this.$refs.dialog.close()
    },
    click() {
      console.log('click')
    }
  }
}
</script>
<style lang='scss' scoped>
</style>